/// 客户端用户注册参数
class ClientUserRegistDto {
  /// 用户ID
  final int? userId;
  /// 用户姓名
  final String fullName;
  /// 用户名
  final String userName;
  /// 密码
  final String password;
  /// 电话号码
  final String phone;
  /// 邮箱
  final String email;
  /// 邀请码
  final String? referral;
  /// 客户端注册验证码
  final String verifyCode;

  ClientUserRegistDto({
    this.userId,
    required this.fullName,
    required this.userName,
    required this.password,
    required this.phone,
    required this.email,
    this.referral,
    required this.verifyCode,
  });

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (userId != null) data['userId'] = userId;
    data['fullName'] = fullName;
    data['userName'] = userName;
    data['password'] = password;
    data['phone'] = phone;
    data['email'] = email;
    if (referral != null) data['referral'] = referral;
    data['verifyCode'] = verifyCode;
    return data;
  }

  factory ClientUserRegistDto.fromJson(Map<String, dynamic> json) {
    return ClientUserRegistDto(
      userId: json['userId'],
      fullName: json['fullName'],
      userName: json['userName'],
      password: json['password'],
      phone: json['phone'],
      email: json['email'],
      referral: json['referral'],
      verifyCode: json['verifyCode'],
    );
  }
}